<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<!--  JavaScript -->
		<link href="<c:url value="/js/bootstrap-3.2.0-dist/css/bootstrap.min.css"/>" rel="stylesheet">
		<script src="<c:url value="/js/jquery9.js" />"></script>
		<script src="<c:url value="/js/functions.js" />"></script>
		<script src="<c:url value="/js/bootstrap-3.2.0-dist/js/bootstrap.min.js" />"></script>
		<!-- Fin JavaScript -->
	</head>	
<body>
	<div class="page-header">
		<h1>Employees</h1>
	</div>
	<p>${message}</p>
	<c:url var="em1" value="/employee/"/>
	<a href='<c:out value="${em1}"/>'>Add Employee <span class="glyphicon glyphicon-plus"></span></a>
	<div class="panel panel-default" style="width:500px;">
		<div class="panel-heading">List Employees</div>
		<table class="table">
		<tr>
			<th>First Name</th>
			<th>Last Name</th>
			<th>Salary($)</th>
			<th></th>
		</tr>
		<c:forEach var="employee" items="${employees}">
			<tr>
				<c:url var="editEmployee" value="/editEmployee/">
	            	<c:param name="id" value="${employee.id}" />
	        	</c:url>
	        <c:url var="deleteEmployee" value="/deleteEmployee/">
	            <c:param name="id" value="${employee.id}" />
	        </c:url>
	
	       <td>${employee.firstName}</td>
	        <td>${employee.lastName}</td> 
	        <td>${employee.salary}</td> 
		       <td>
		            <a href='<c:out value="${editEmployee}"/>'>Edit <span class="glyphicon glyphicon-pencil"></span></a>
		                <a href='<c:out value="${deleteEmployee}"/>' class="link-delete">Delete<span class="glyphicon glyphicon-minus"></span></a>
		        </td>
			</tr>
		</c:forEach>	
		</table>
	</div>
</body>
</html>